package main

import (
	"database/sql"
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"log"
)

const (
	USERNAME = "root"
	PASSWORD = "root"
	HOST     = "172.20.0.10"
	PORT     = 3306
	DBNAME   = "gogogo"
)

func main() {
	db, err := sql.Open("mysql",
		fmt.Sprintf("%s:%s@tcp(%s:%d)/%s", USERNAME, PASSWORD, HOST, PORT, DBNAME))
	fmt.Println(db)
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	err = db.Ping()
	if err != nil {
		log.Fatal(err)
	}
}
